package com.zyz.study.controller;
import dev.langchain4j.model.chat.ChatModel;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController // 标记该类为Rest风格的控制器，返回的数据会自动序列化为JSON格式
@RequestMapping("/deepseekr1test")// 映射所有请求方式的 /ollamachat 路径
@Tag(name = "云端DeepSeek")  // Swagger注解，给该控制器的接口打上“用户管理”标签，便于文档分组显示
public class DeepSeekR1Controller {

    @Resource(name = "DeepSeekR1_0528_chatModel")
    private ChatModel DeepSeekR1_0528_chatModel;

    @GetMapping(value = "/hello")
    public String hello(@RequestParam(value = "question",defaultValue = "你是什么版本的,请你详细的说说你的版本型号") String question) {
        String result = DeepSeekR1_0528_chatModel.chat(question);
        System.out.println("result = " + result);
        return result;
    }

}
